package com.controller
{
	import view.custombar.CustomBar;
	
	import xm.control.Navigator;
	import xm.core.XMSprite;
	import xm.definition.Align;
	
	
	/**
	 * <br> 클래스 설명 : </br>
	 * @author 강석민
	 */	
	public class CustomBarController extends XMSprite
	{
		private var _isON : Boolean = false;
		private var cb : CustomBar = new CustomBar();
		
		private static var _instance : CustomBarController;
		public static function get instance():CustomBarController
		{
			if( _instance == null ) _instance = new CustomBarController();
			return _instance;
		}
		
		/**
		 * constructor 
		 */	
		public function CustomBarController()
		{
			super();
			
			cb.align = Align.BOTTOM;
			cb.y = 762-80;
			cb.viewWidth = 480;
			cb.viewHeight = 100;
		}
		
		
		/**
		 * ON
		 */	
		public function ON():void
		{
			if( _isON == true) return;
			_isON = true;
			Navigator.getInstance().addCustomBar( cb );
		}
		
		/**
		 * OFF
		 */		
		public function OFF():void
		{
			if( _isON == false ) return;
			_isON = false;
			Navigator.getInstance().removeCustomBar( cb );
		}
		
		
		
	}
}